/**
 * 
 */
package cn.com.gzheroli.core.beetlsql;

import javax.sql.DataSource;

import org.beetl.sql.ext.spring4.BeetlSqlDataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;

import com.alibaba.druid.pool.DruidDataSource;

/**  
* @类名: BeetlSqlDataSource  
* @描述: TODO(这里用一句话描述这个类的作用)  
* @作者: 李长荣 lichang_20011@163.com  
* @日期: 2017年9月12日  上午8:24:57
*@version V1.0  
*    
*/
public class HeroBeetlSqlDataSource extends BeetlSqlDataSource{
//	@Bean
//	public BeetlSqlDataSource beetlSqlDataSource(@Qualifier("masterDataSource")  DataSource dataSource,@Qualifier("slavesDataSource")  DataSource slave){
//	    BeetlSqlDataSource source = new BeetlSqlDataSource();
//	    source.setMasterSource(dataSource);
//	    source.setSlaves(new DataSource[]{slave});
//	    return source;
//	}
	private DruidDataSource masterDataSource;
	public void setMasterDataSource(DruidDataSource masterDataSource) {
		this.masterDataSource = masterDataSource;
		this.master=(DataSource)masterDataSource;
	}
	public void setSlavesDataSource(DruidDataSource[] slavesDataSource) {
		this.slavesDataSource = slavesDataSource;
		setSlaves(new DataSource[]{(DataSource)slavesDataSource[0]});
	}
	private DruidDataSource []slavesDataSource;
	
	
}
